package com.hsytech.baoinbao;

import android.content.Context;
import android.content.SharedPreferences;

public class SharedPreferencesTools {


    public static void writeToken(Context context, String token) {
        SharedPreferences sp = context.getSharedPreferences(Constants.COMMON_TOKEN, Context.MODE_PRIVATE);
        SharedPreferences.Editor ed = sp.edit();
        ed.putString(Constants.TOKEN, token);
        ed.commit();
    }

    public static String getTOKEN(Context context) {
        String result = null;
        SharedPreferences sp = context.getSharedPreferences(Constants.COMMON_TOKEN, Context.MODE_PRIVATE);
        result = sp.getString(Constants.TOKEN, null);
        return result;
    }


}
